class Message {
  final String id;
  final String name;
  final String sender;
  final String receiver;
  final String msg;
  final int isRead;
  final String addTime;

  const Message(
      {required this.id,
      required this.name,
      required this.sender,
      required this.receiver,
      required this.msg,
      required this.isRead,
      required this.addTime});

  factory Message.fromJson(Map<String, dynamic> jsonobj) {
    var item = Message(
        id: jsonobj['_id'],
        name: jsonobj['name'],
        sender: jsonobj['sender'],
        receiver: jsonobj['receiver'],
        msg: jsonobj['msg'],
        isRead: jsonobj['is_read'],
        addTime: jsonobj['add_time']);
    return item;
  }
}
